package com.example.oasystem.dao.mail;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.oasystem.entity.mail.AoaInMailListOfSun;
import com.example.oasystem.entity.mail.AoaMailReciverOfSun;
import com.example.oasystem.entity.mail.AoaMailnumberOfl;
import com.example.oasystem.entity.status.AoaStatusList;
import com.example.oasystem.entity.type.AoaTypeList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AoaInMailListDaoOfSun extends BaseMapper<AoaInMailListOfSun> {


    List<AoaInMailListOfSun> selectInboxNum(@Param("baseKey") String baseKey, @Param("userId")long userId);

    List<AoaInMailListOfSun> selectOutboxNum(@Param("baseKey") String baseKey, @Param("userId")long userId);

    List<AoaInMailListOfSun> selectDraftBoxNum(@Param("baseKey") String baseKey, @Param("userId")long userId);

    List<AoaInMailListOfSun> selectMailTrashCanNum(@Param("baseKey") String baseKey, @Param("userId")long userId);

    List<AoaInMailListOfSun> selectReciverTrashCanNum(@Param("baseKey") String baseKey, @Param("userId")long userId);

    AoaInMailListOfSun selectOneMail(@Param("id") long id);

    List<AoaMailnumberOfl> selectMailNum(@Param("userId")long userId);

    List<AoaTypeList> selectTypeList();

    List<AoaStatusList> selectStatusList();

    void addMail(AoaInMailListOfSun aoaInMailListOfSun);

    void addMailNum(AoaMailReciverOfSun aoaMailnumberOfSun);


    void updateMailInbox(@Param("isRead")int isRead,@Param("isStar")int isStar,@Param("isDel")int isDel,@Param("ids") List<Long> ids,@Param("userId")long userId);

    void updateMailOutbox(@Param("mailStar")int mailStar,@Param("mailDel")int mailDel,@Param("mailPush")int mailPush,@Param("ids") List<Long> ids);

    void deleteMail(@Param("userId") long userId, @Param("a") List<Long> a);


    void deleteReciver(@Param("userId") long userId, @Param("b") List<Long> b);

    void updateMail(@Param("mail") AoaInMailListOfSun mail);
}